﻿<UserControl x:Class="MedLink2011.Views.Patients.Controls.FirstLook.SchedulerExample"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
		xmlns:telerikScheduler="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Scheduler"
             xmlns:local="clr-namespace:MedLink2011.Views.Patients.Controls.FirstLook" 
             xmlns:telerikApps="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls" 
             xmlns:Converters="clr-namespace:MedLink2011.Views.Patients.Controls.FirstLook.Converters">

	<telerikApps:QuickStart.ExampleHeader>
		<Grid>
			<TextBlock Text="First Look" Margin="8" />
		</Grid>
	</telerikApps:QuickStart.ExampleHeader>
	<UserControl.Resources>
		<LinearGradientBrush x:Key="LegendBackground" EndPoint="1,1.004" StartPoint="-0.001,0.014">
			<GradientStop Color="#FFFBFCFC" Offset="0.09" />
			<GradientStop Color="#FFFBFCFC" Offset="0.961" />
			<GradientStop Color="#FFE9F0F8" Offset="0.18" />
			<GradientStop Color="#FFFBFCFC" Offset="0.242" />
			<GradientStop Color="#FFFBFCFC" Offset="0.535" />
			<GradientStop Color="#FFECF2F8" Offset="0.773" />
			<GradientStop Color="#FFFBFCFC" Offset="0.832" />
			<GradientStop Color="#FFECF2F8" Offset="0.461" />
			<GradientStop Color="#FFECF2F8" Offset="0.902" />
		</LinearGradientBrush>
		<SolidColorBrush x:Key="LegendForeground" Color="#FF1E395B" />
		<SolidColorBrush x:Key="LegendBorderBrush" Color="#FFC0CBD9" />
	</UserControl.Resources>

	<Grid>
		<Grid.Resources>
			<local:SpeakersList x:Key="Speakers" />
			<Converters:StatusConverter x:Key="StatusConverter" />
			<Converters:DateFormatConverter x:Key="DateFormatConverter" />
			<Converters:CategoryToVisibilityConverter x:Key="CategoryToVisibilityConverter" />
			<Converters:CategoryToVisibilityReverseConverter x:Key="CategoryToVisibilityReverseConverter" />
			<Converters:CategoryToBackgroundConverter x:Key="CategoryToBackgroundConverter" />
			<Converters:SpeakerToImageConverter x:Key="SpeakerToImageConverter" />
			<Style x:Key="AppointmentSubjectTextBox" TargetType="TextBox">
				<Setter Property="BorderThickness" Value="0" />
				<Setter Property="MaxHeight" Value="50" />
				<Setter Property="Background" Value="Transparent" />
				<Setter Property="Margin" Value="0" />
				<Setter Property="Padding" Value="0" />
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="TextBox">
							<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1"
									UseLayoutRounding="True">
								<ScrollViewer BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"
										x:Name="ContentElement" />
							</Border>

						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
			<DataTemplate x:Key="AppointmentTemplate">
				<Grid Background="Transparent">
					<telerik:RadContextMenu.ContextMenu>
						<telerik:RadContextMenu ItemClick="RadContextMenu_ItemClick">
							<telerik:RadMenuItem Header="Abrir" />
							<telerik:RadMenuItem Header="Eliminar" />
							<telerik:RadMenuItem IsSeparator="True" />
							<telerik:RadMenuItem Header="Nueva Cita" />
						</telerik:RadContextMenu>
					</telerik:RadContextMenu.ContextMenu>
					<ToolTipService.ToolTip>
						<Border Width="255" Height="255" CornerRadius="2">
							<Grid Margin="3,8,0,15" Width="242">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="55" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="60" />
									<RowDefinition Height="50" />
									<RowDefinition Height="50" />
									<RowDefinition MinHeight="100" />
								</Grid.RowDefinitions>
								<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" VerticalAlignment="Top"
										Height="56" BorderBrush="#FF417542" BorderThickness="1,1,1,1"
										CornerRadius="2,2,2,2" Width="240" HorizontalAlignment="Left">

									<Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1"
											Background="{Binding Path=Occurrence.Appointment.Category.CategoryBrush}">
										<TextBlock Text="{Binding Path=Occurrence.Appointment.Subject}"
												TextWrapping="Wrap" TextAlignment="Left" FontWeight="Bold"
												VerticalAlignment="Center" Height="31" Width="200"
												HorizontalAlignment="Left" Margin="5,0,0,0" />
									</Border>
								</Border>
								<TextBlock TextWrapping="Wrap" FontStyle="Italic" Grid.Column="0" Grid.ColumnSpan="2"
										Width="230" Grid.Row="1"
										Text="{Binding Path=Occurrence, Converter={StaticResource DateFormatConverter}}"
										TextAlignment="Left" HorizontalAlignment="Left" />

								<Border Grid.Column="0" Grid.Row="2"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}"
										VerticalAlignment="Top" Height="50" BorderBrush="#FF417542"
										BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" HorizontalAlignment="Left">

									<Border
											Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}"
											BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1"
											Background="Transparent">
										<Image
												Source="{Binding Path=Occurrence.Appointment.Speaker, Converter={StaticResource SpeakerToImageConverter}}"
												Height="50" Width="50" HorizontalAlignment="Stretch"
												Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}" />
									</Border>
								</Border>
								<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityReverseConverter}}"
										VerticalAlignment="Top" Height="50" BorderBrush="#FF417542"
										BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" HorizontalAlignment="Center">

									<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" BorderBrush="#FFFFFFFF"
											BorderThickness="1,1,1,1" CornerRadius="1,1,1,1" Background="{Binding Path=Occurrence.Appointment.Category.CategoryBrush, 
											Converter={StaticResource CategoryToBackgroundConverter}}">
										<Image Source="../../Images/lunch.png" Height="100" Width="100"
												HorizontalAlignment="Center"
												Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityReverseConverter}}" />
									</Border>
								</Border>

								<TextBlock Grid.Column="1" Grid.Row="2" FontStyle="Italic" FontSize="12" Text="by"
										HorizontalAlignment="Left"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}" />
								<TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold"
										Text="{Binding Path=Occurrence.Appointment.Speaker}" Width="150"
										Margin="20,0,0,0" HorizontalAlignment="Left"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}" />
								<TextBlock Grid.Column="1" Grid.Row="0" Text="Level:" Width="30" TextAlignment="Left"
										HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,40,7"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}" />
								<TextBlock Grid.Column="1" Grid.Row="0"
										Text="{Binding Path=Occurrence.Appointment.Level}" VerticalAlignment="Bottom"
										Margin="0,0,10,7" HorizontalAlignment="Right"
										Visibility="{Binding Path=Occurrence.Appointment.Category, Converter={StaticResource CategoryToVisibilityConverter}}" />

								<TextBlock Grid.Column="0" Grid.ColumnSpan="2" Height="100" Width="230"
										TextWrapping="Wrap" Grid.Row="3"
										Text="{Binding Path=Occurrence.Appointment.Body}" HorizontalAlignment="Left"
										VerticalAlignment="Top" Margin="0,5,0,0" />

							</Grid>
						</Border>
					</ToolTipService.ToolTip>
					<TextBox x:Name="PART_SubjectTextBox" Margin="7 0 5 0" VerticalAlignment="Top"
							HorizontalAlignment="Stretch" Text="{Binding Path=Occurrence.Appointment.Subject}"
							IsHitTestVisible="False" Style="{StaticResource AppointmentSubjectTextBox}"
							Foreground="Black" TextWrapping="Wrap" Background="Transparent" BorderThickness="0" />
				</Grid>
			</DataTemplate>
		</Grid.Resources>

		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Border Grid.Row="1" telerikApps:ThemeAwareBackgroundBehavior.IsEnabled="True" Margin="1" />
		<telerikScheduler:RadScheduler x:Name="scheduler" Grid.Row="1" DisplayEmptyGroup="True" OpenModalDialogs="True"
				AppointmentTemplate="{StaticResource AppointmentTemplate}"
				AppointmentCreating="scheduler_AppointmentCreating" ViewMode="Week"
				MonthViewScrollBarVisibility="Collapsed">
			<telerikScheduler:RadScheduler.WeekViewDefinition>
				<telerikScheduler:WeekViewDefinition DayStartTime="8:00:00" DayEndTime="19:00:00"
						TimeSlotLength="0:30:0" LargeChangeInterval="7d" />
			</telerikScheduler:RadScheduler.WeekViewDefinition>
			<telerikScheduler:RadScheduler.DayViewDefinition>
				<telerikScheduler:DayViewDefinition DayStartTime="8:00:00" DayEndTime="19:00:00"
						TimeSlotLength="0:30:0" />
			</telerikScheduler:RadScheduler.DayViewDefinition>
			<telerik:RadContextMenu.ContextMenu>
				<telerik:RadContextMenu ItemClick="RadContextMenu_ItemClick">
					<telerik:RadMenuItem Header="Nueva Cita" />
					<telerik:RadMenuItem Header="Nuevo Evento de todo el dia" />
				</telerik:RadContextMenu>
			</telerik:RadContextMenu.ContextMenu>
			<telerikScheduler:RadScheduler.Categories>
				<telerikScheduler:Category CategoryName="WebDevelopement" DisplayName="Web Developement"
						CategoryBrush="{StaticResource WebDevelopementBrush}" />
				<telerikScheduler:Category CategoryName="Architectures"
						CategoryBrush="{StaticResource ArchitecturesBrush}" />
				<telerikScheduler:Category CategoryName="WindowsAndFrameworks" DisplayName="Windows And Frameworks"
						CategoryBrush="{StaticResource WindowsAndFrameworksBrush}" />
				<telerikScheduler:Category CategoryName="LunchAndCoffee" DisplayName="Lunch And Coffee"
						CategoryBrush="{StaticResource LunchAndCoffeeBrush}" />
				<telerikScheduler:Category CategoryName="Sharepoint" CategoryBrush="{StaticResource SharepointBrush}" />
				<telerikScheduler:Category CategoryName="DataLayers" DisplayName="Data Layers"
						CategoryBrush="{StaticResource DataLayersBrush}" />
			</telerikScheduler:RadScheduler.Categories>
					<telerikScheduler:RadScheduler.ResourceTypes>
					<telerikScheduler:ResourceType Name="Speaker">
				</telerikScheduler:ResourceType>
				<telerikScheduler:ResourceType Name="Level">
					<telerikScheduler:ResourceType.Resources>
						<telerikScheduler:Resource ResourceName="100" DisplayName="Level 100" />
						<telerikScheduler:Resource ResourceName="200" DisplayName="Level 200" />
						<telerikScheduler:Resource ResourceName="300" DisplayName="Level 300" />
						<telerikScheduler:Resource ResourceName="400" DisplayName="Level 400" />
					</telerikScheduler:ResourceType.Resources>
				</telerikScheduler:ResourceType>
				<telerikScheduler:ResourceType Name="Room" DisplayName="Session Room">
					<telerikScheduler:ResourceType.Resources>
						<telerikScheduler:Resource ResourceName="406" />
						<telerikScheduler:Resource ResourceName="406A" />
						<telerikScheduler:Resource ResourceName="406B" />
						<telerikScheduler:Resource ResourceName="407" />
					</telerikScheduler:ResourceType.Resources>
				</telerikScheduler:ResourceType>
			</telerikScheduler:RadScheduler.ResourceTypes>
		</telerikScheduler:RadScheduler>
		<Border Grid.Row="2" VerticalAlignment="Top" Background="{StaticResource LegendBackground}"
				BorderBrush="{StaticResource LegendBorderBrush}" BorderThickness="1 0 1 1">
			<StackPanel Orientation="Horizontal" Margin="1" HorizontalAlignment="Center">
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="10 4 0 4" BorderBrush="#FF417542"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"
						Background="{StaticResource WebDevelopementBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}"
						Text="Web Developement"></TextBlock>
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="0 4" BorderBrush="#FF0465B3"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"
						Background="{StaticResource WindowsAndFrameworksBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}" Text="Frameworks"></TextBlock>
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="0 4" BorderBrush="#FF973FA8"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"
						Background="{StaticResource ArchitecturesBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}" Text="Architectures"></TextBlock>
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="0 4" BorderBrush="#FFE69E07"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"
						Background="{StaticResource LunchAndCoffeeBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}"
						Text="Lunch And Coffee"></TextBlock>
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="0 4" BorderBrush="#FFE74220"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" Background="{StaticResource SharepointBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}" Text="Sharepoint"></TextBlock>
				<Border VerticalAlignment="Center" Width="24" Height="14" Margin="0 4" BorderBrush="#FFBD0037"
						BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" Background="{StaticResource DataLayersBrush}" />
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Stretch" Margin="2 0 16 0" FontSize="10"
						VerticalAlignment="Center" Foreground="{StaticResource LegendForeground}" Text="Data Layers"></TextBlock>
			</StackPanel>
		</Border>
	</Grid>
</UserControl>